package com.study.jdk8v2;

import java.util.function.Supplier;

/**
 * <p>添加类描述</p>
 *
 * @author chentao
 * @version v 0.1 2021/2/21 17:56
 */
public class Car {
    public static Car create( final Supplier< Car > supplier ) {
        return supplier.get();
    }

    public static void collide( final Car car ) {
        System.out.println( "Collided " + car.toString() );
    }

    public void follow( final Car another ) {
        System.out.println( "Following the " + another.toString() );
    }

    public void repair() {
        System.out.println( "Repaired " + this.toString() );
    }

}
